fix(supervisor-network): omit absent L7 selectors from policy data - #3200
Conversation
Build protobuf-derived allow objects from selectors that are actually present. This keeps protobuf and YAML policy validation aligned for protocols such as GraphQL over WebSocket. Signed-off-by: Shiju <shiju@nvidia.com>
johntmyers
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
This focused fix is project-valid under #3092. The initial code review found no blocking defects: the protobuf projection now omits absent scalar selector keys while preserving populated scalar and structured selectors, matching the key-presence semantics consumed by L7 validation.
Blocking findings:
- No blocking findings remain
Carried findings:
- None
Non-blocking suggestions:
- None
Gator metadata
- Validation: Focused one-file policy correctness fix linked to #3092
- Docs: Not needed because this changes internal protobuf-to-OPA projection semantics without changing the user-facing policy contract
- Checks: Branch Checks and Helm Lint are green for the current head; required E2E dispatch is pending
- E2E:
test:e2erequired for policy enforcement behavior and applied for current-head dispatch - Head SHA:
9cc82c63041aa8ee8327229f7e1299e42edbebf8 - Base SHA:
592df3e01489b3fd2af5573e1feb043108596aed - Merge base SHA:
592df3e01489b3fd2af5573e1feb043108596aed - Patch ID:
c56d9f9b78da4a7597a0a137dd824f0ae43529aa - Gator payload:
8 - Review mode:
initial - Previous reviewed SHA: none
- Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:in-review
|
Label |
Monitoring CompleteMonitoring is complete because this PR has merged. Final status: Gator review found no blocking defects, required E2E completed, and maintainer approval was present before merge. I removed the active Gator metadata
|
Summary
Omit absent protobuf L7 scalar selectors when constructing OPA policy data. This gives protobuf and YAML inputs the same selector-key presence semantics, preventing an otherwise valid protocol rule from being classified as a mixed selector family because proto3 represented unrelated fields as empty strings.
Related Issue
Part of #3092.
Changes
allowobject from selectors that are actually present instead of inserting emptymethod,path,command,operation_type, andoperation_namevalues.fields,query, andparamswithout changing the policy schema or enforcement rules.Testing
mise run pre-commitpassesChecklist